<?php
  // Global variables.
  $globalDBHostname = "localhost";
  $globalDBName = "yourdbnamehere";
  $globalDBUsername = "yourdbusernamehere";
  $globalDBPassword = "yourdbpasshere";

  function connect($hostname, $dbname, $dbusername, $password) {
    $connect = mysql_pconnect($hostname, $dbusername, $password) or die ("Unable to connect to the database");
    $selectdb = mysql_select_db($dbname) or die ('Database does not exists');
    return $connect;
  }

  connect($globalDBHostname, $globalDBName, $globalDBUsername, $globalDBPassword);
?>
